<!--  -->
<template>
  <div v-if="Object.keys(commentInfo).length !== 0" class="comment-info">
    <div class="info-header">
      <div class="header-title">用户评价</div>
      <div class="header-more">
        更多
        <i class="iconfont el-icon-arrow-right"></i>
      </div>
    </div>

    <div class="info-user">
      <img :src="commentInfo.user.avatar" alt="" />
      <span>{{ commentInfo.user.uname }}</span>
    </div>
    <div class="info-detail">
      <p>{{ commentInfo.content }}</p>
      <div class="info-other">
        <span class="data">{{ commentInfo.created | showData }}</span>
        <span>{{ commentInfo.style }}</span>
      </div>
      <div class="info-imgs">
        <img
          :src="item"
          v-for="(item, index) in commentInfo.images"
          :key="index"
          alt=""
        />
      </div>
    </div>
  </div>
</template>

<script>
import {fonmatDate} from 'common/utils'
export default {
  name: "",
  props: {
    commentInfo: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  filters:{
      showData(value){
          const date = new Date(value*1000)
          return fonmatDate(date,'yyyy-MM-dd hh:mm:ss')

      }
  }
};
</script>

<style scoped>
.comment-info {
  padding: 10px 15px;
  font-size: 14px;
  border-bottom: 5px solid #f2f5f8;
}
.info-header {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #ddd;
  font-size: 16px;
}
.header-title{
    float: left;
}
.header-more{
    float: right;
}
.info-user{
    padding: 20px 0;
    display: flex;
    line-height: 60px;
}
.info-user img{
    width: 60px;
    height: 60px;
    border-radius: 50%;
}
.info-user span{
    font-size: 17px;
    font-weight: bold;
    margin-left: 10px;
}
.info-detail p{
    font-size: 17px;
    text-indent: 2em;
    line-height: 2em;
}
.info-other {
    color: #B0B0B0;
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    margin-bottom: 10px;
}
.info-other span{
    margin-left: 8px;
}
.info-imgs{
  display: flex;
}
.info-imgs img{
  width: 40%;
}
</style>